<?php
class User
{
	var $userName = "";
	var $userID = "";//存放的是玩家对应的socketID
	var $roomID = "";
	var $tableID = "";
	var $seatID = "";
	var $level = "0";
	var $userPass = "";
	var $headURL = "";
	var $start = false;
	var $roll = 0;

	function __toString()
	{
		return '{"name":"'.$this->userName.'","headURL":"'.$this->headURL.'","level":"'.$this->level.'","userID":"'.$this->userID.'","roomID":"'.$this->roomID.'","tableID":"'.$this->tableID.'","seatID":"'.$this->seatID.'","start":"'.$this->start.'","roll":"'.$this->roll.'"}';
	}
	function login($name,$pass,$ip)
	{
		$this->userID = $ip;
		$this->userName = $name;
		$this->userPass = $pass;

		$headSet = array("okaro","naruto","kakaxi","itachi","dashewang");
		$this->headURL = $headSet[rand(0,4)];
		UserCenter::getInstance()->userList[$ip]=$this;
	}

	function enterRoom($roomID)
	{
		$this->roomID = $roomID;
	}

	function sitDown($seat,$tableID)
	{
		$this->tableID = $tableID;
		$this->seatID = $seat->seatID;
	}

	function standUp()
	{
		$this->tableID="";
		$this->seatID="";
		$this->roll = 0;
	}

}//end of class User